﻿using System;
using System.Collections.Generic;
using System.Drawing;
using RaytracerLib.Layers;
using RaytracerLib.MathLib;
using TomanuExtensions;
using RaytracerLib.Layers.OverlayCorrectors;

namespace RaytracerLib.Resamplers.Filters
{
    public abstract class Filter
    {
        protected double m_ray;

        public static Filter Create(FilterType a_type)
        {
            if (a_type == FilterType.Bicubic)
                return new BicubicFilter();
            else if (a_type == FilterType.Box)
                return new BoxFilter();
            else if (a_type == FilterType.Lanczos)
                return new LanczosFilter();
            else if (a_type == FilterType.Triangle)
                return new TriangleFilter();
            else if (a_type == FilterType.Mitchell)
                return new MitchellFilter();
            else if (a_type == FilterType.Gaussian)
                return new GaussianFilter();
            else if (a_type == FilterType.NearestNeighbour)
                return new NearestNeighbourFilter();
            else
                throw new NotImplementedException();
        }

        protected Filter(double a_ray)
        {
            m_ray = a_ray;
        }

        public double Ray
        {
            get
            {
                return m_ray;
            }
        }

        public abstract FilterType FilterType { get; }
        public abstract string Name { get; }
        public abstract double Evaluate(double a_value);
    }
}